<?php

/**
 * @Author: Wang Chunsheng 2192138785@qq.com
 * @Date:   2020-03-09 23:19:04
 * @Last Modified by:   Wang Chunsheng 2192138785@qq.com
 * @Last Modified time: 2020-03-19 16:56:18
 */

namespace api\modules\diandi_shop\controllers;

use Yii;
use api\controllers\AController;
use app\modules\diandi_shop\models\DdDiandiShopStore;
use common\helpers\ImageHelper;
use common\helpers\ResultHelper;

class StoreController extends AController
{
    public $modelClass = '\common\models\DdGoods';
    protected $authOptional = ['info'];

    /**
     * @SWG\Post(path="/diandi_shop/store/info",
     *     tags={"商家"},
     *     summary="商家信息.",
     *     @SWG\Response(
     *         response = 200,
     *         description = "商家信息",
     *         @SWG\Schema(ref = "#/definitions/Docs")
     *     )
     * )
     */
    public function actionInfo()
    {
        $info = Yii::$app->settings->getAllBySection('DiandiShopStroe');
        $info['logo'] = ImageHelper::tomeia($info['logo']);
        $info['banner'] = ImageHelper::tomeia($info['banner']);

        return ResultHelper::json(200, '获取成功', $info);
    }
}
